﻿namespace WatiNSahi.Extensions
{
    using global::WatiN.Core;

    public static class ButtonCollectionExtensions
    {
        public static bool Exists(this ButtonCollection buttonCollection, string buttonIdOrNameOrValueorClass, bool extension = true)
        {
            return buttonCollection.Exists(Find.ById(buttonIdOrNameOrValueorClass)) ||
                buttonCollection.Exists(Find.ByName(buttonIdOrNameOrValueorClass)) ||
                buttonCollection.Exists(Find.ByValue(buttonIdOrNameOrValueorClass)) ||
                buttonCollection.Exists(Find.ByClass(buttonIdOrNameOrValueorClass)) ||
                buttonCollection.Exists(Find.ByLabelText(buttonIdOrNameOrValueorClass));
        }
    }
}